//
//  zhViewController.m
//  何五路
//
//  Created by _ADY on 15/6/25.
//  Copyright (c) 2015年 _ADY. All rights reserved.
//

#import "zhViewController.h"

@interface zhViewController ()

@end

@implementation zhViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title = @"找回密码";
        self.view.backgroundColor = bgColor;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    account = [[UITextField alloc] initWithFrame:CGRectMake(10, 100, screenMySize.size.width-20, 40)];
    [account setFont:[UIFont systemFontOfSize:labelSize]];
    account.returnKeyType = UIReturnKeyNext;
    [account setClearButtonMode:UITextFieldViewModeWhileEditing];
    account.delegate = self;
    account.layer.cornerRadius=3.0f;
    account.layer.masksToBounds=YES;
    account.backgroundColor=[UIColor whiteColor];
    account.layer.borderColor=[[UIColor grayColor]CGColor];
    account.layer.borderWidth= 1.0f;
    [account setPlaceholder:@"用户名/邮箱/已验证手机号"];
    [self.view  addSubview:account];
    
    
    password = [[UITextField alloc] initWithFrame:CGRectMake(10, 150, 100, 40)];
    [password setFont:[UIFont systemFontOfSize:labelSize]];
    password.returnKeyType = UIReturnKeyGo;
    [password setClearButtonMode:UITextFieldViewModeWhileEditing];
    password.delegate = self;
    password.layer.cornerRadius=3.0f;
    password.layer.masksToBounds=YES;
    password.backgroundColor=[UIColor whiteColor];
    password.layer.borderColor=[[UIColor grayColor]CGColor];
    password.layer.borderWidth= 1.0f;
    [password setPlaceholder:@"请输入验证码"];
    [self.view  addSubview:password];
    
    UIImageView *bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(150,120, 100, 40)];
//    [bgImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[dictionary objectForKey:@"imageUrl"]]]];
    bgImageView.contentMode =  UIViewContentModeScaleAspectFill;
    bgImageView.clipsToBounds  = YES;
    [self.view addSubview:bgImageView];
    
    UIButton *zhButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [zhButton setFrame:CGRectMake(230,150, screenMySize.size.width-230-10, 40)];
    [zhButton setTitle:@"换一张" forState:UIControlStateNormal];
    [zhButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [zhButton addTarget:self action:@selector(zhAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:zhButton];
    
    UIButton *xButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [xButton setFrame:CGRectMake(10, 180+40, screenMySize.size.width-20, 40)];
    [xButton setTitle:@"下一步" forState:UIControlStateNormal];
    [xButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [xButton setBackgroundImage:[UIImage imageNamed:@"enButtons"] forState:UIControlStateNormal];
    [xButton addTarget:self action:@selector(xAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:xButton];
    
    
}

-(void)zhAction
{
    
}

-(void)xAction
{
    
}

#pragma mark -
#pragma mark UITextFieldDelegate
//限制输入长度 by zwb 2011.9.6
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    return YES;
    
}


- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    if (textField == account) {
        [password becomeFirstResponder];
    }
    else
    {
        [textField resignFirstResponder];
    }

    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
